Skip to content

[full-ci][tests-only] test: convert admin-settings-spaces.feature to playwright#13488

Merged
anon-pradip merged 6 commits intomasterfrom
test/e2e-playwright-admin-settings-spaces.feature
Mar 23, 2026
Merged

[full-ci][tests-only] test: convert admin-settings-spaces.feature to playwright#13488
anon-pradip merged 6 commits intomasterfrom
test/e2e-playwright-admin-settings-spaces.feature

Conversation

@anon-pradip
Copy link
Copy Markdown
Contributor

@anon-pradip anon-pradip commented Jan 16, 2026

Description

convert spaces.feature test to playwright test

Regarding the use of shared.ts
Problem

Playwright e2e tests failed when keycloak was enabled in CI with error:

TypeError: Cannot read properties of undefined (reading 'newContext')

The root cause was twofold:

  1. keycloak/user.ts imported state from cucumber/environment/shared, but playwright had its own e2e-playwright/support/shared.ts - different modules with different browser instances
  2. The globalBeforeHook used api.token.setAccessAndRefreshToken which performs oCIS auth flow, incompatible with keycloak

Solution

  1. Deleted e2e-playwright/support/shared.ts

  2. Updated e2e-playwright/support/test.ts and e2e-playwright/support/world.ts to import state from cucumber/environment/shared - the single shared state used by both frameworks

  3. Added keycloak token setup in globalBeforeHook (matching cucumber's Before hook):

    • api.keycloak.setAccessTokenForKeycloakOcisUser(user)
    • api.keycloak.setAccessTokenForKeycloakUser(user)
    • storeKeycloakGroups(user, usersEnvironment)

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests
  • Documentation
  • Maintenance (e.g. dependency updates or tooling)

Open tasks:

  • ...

@anon-pradip anon-pradip self-assigned this Jan 16, 2026
@anon-pradip anon-pradip force-pushed the test/e2e-playwright-admin-settings-spaces.feature branch from 425b360 to af00be4 Compare January 19, 2026 04:03
@anon-pradip anon-pradip force-pushed the test/e2e-playwright-admin-settings-spaces.feature branch 9 times, most recently from 4af8285 to 358c812 Compare January 20, 2026 10:48
@anon-pradip anon-pradip marked this pull request as ready for review January 21, 2026 04:24
Comment thread tests/e2e-playwright/steps/api/api.ts Outdated
Comment thread tests/e2e-playwright/specs/oidc/refreshToken.spec.ts Outdated
Comment thread tests/e2e-playwright/specs/admin-settings/spaces.spec.ts
Comment thread tests/e2e-playwright/specs/admin-settings/spaces.spec.ts Outdated
Comment thread tests/e2e-playwright/steps/ui/spaces.ts Outdated
Comment thread tests/e2e-playwright/specs/admin-settings/spaces.spec.ts Outdated
Comment thread tests/e2e-playwright/specs/admin-settings/spaces.spec.ts Outdated
Comment thread tests/e2e-playwright/steps/ui/spaces.ts Outdated
Comment thread tests/e2e-playwright/specs/admin-settings/spaces.spec.ts Outdated
Comment thread tests/e2e-playwright/specs/admin-settings/spaces.spec.ts Outdated
Comment thread tests/e2e-playwright/specs/admin-settings/spaces.spec.ts Outdated
@anon-pradip anon-pradip force-pushed the test/e2e-playwright-admin-settings-spaces.feature branch from d191a61 to 5bd42ac Compare March 16, 2026 09:09
@anon-pradip anon-pradip force-pushed the test/e2e-playwright-admin-settings-spaces.feature branch 6 times, most recently from 27fe444 to b918140 Compare March 19, 2026 07:25
Copy link
Copy Markdown
Member

@nabim777 nabim777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

@anon-pradip anon-pradip force-pushed the test/e2e-playwright-admin-settings-spaces.feature branch from b918140 to 4e072ac Compare March 19, 2026 09:29
Comment thread .drone.star
@anon-pradip anon-pradip force-pushed the test/e2e-playwright-admin-settings-spaces.feature branch 2 times, most recently from 59185c1 to 78736b3 Compare March 20, 2026 06:22
@anon-pradip anon-pradip force-pushed the test/e2e-playwright-admin-settings-spaces.feature branch from 78736b3 to cdfe711 Compare March 20, 2026 06:58
@anon-pradip anon-pradip force-pushed the test/e2e-playwright-admin-settings-spaces.feature branch from cdfe711 to 5b2fa88 Compare March 20, 2026 08:07
Comment thread tests/e2e/support/shared.ts Outdated
Comment thread tests/e2e-playwright/support/test.ts Outdated
@anon-pradip anon-pradip force-pushed the test/e2e-playwright-admin-settings-spaces.feature branch 2 times, most recently from 77463f1 to 5b2fa88 Compare March 23, 2026 04:04
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@PrajwolAmatya PrajwolAmatya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@anon-pradip anon-pradip merged commit 22ffc8f into master Mar 23, 2026
4 checks passed
@anon-pradip anon-pradip deleted the test/e2e-playwright-admin-settings-spaces.feature branch March 23, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants